<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title></title>
  <script src="../G.js"></script>
</head>
<body>
<select id="year"></select>
<select id="month"></select>
<select id="day"></select>
<script>
  for(var i=1966;i<=2016;i++){
    $("<option>").appendTo($("#year")).attr("value",i).html(i+"年");
  }
  for(var j=1;j<=12;j++){
    $("<option>").appendTo($("#month")).attr("value",j).html(j+"月");
  }
  $("#month").addEventListener("change",function(e){
    var maxDay;
    if([1,3,5,7,8,10,12].indexOf(Number(e.target.value))>-1){
      maxDay=31;
    }
    else if([4,6,9,11].indexOf(Number(e.target.value))>-1){
      maxDay=30;
    }
    else{
      maxDay=28;
    }
    $("#day").html("");
    for(var n=1;n<=maxDay;n++){
      $("<option>").appendTo($("#day")).attr("value",n).html(n+"天");
    }
  },false)
</script>
</body>
</html>